//第1-4节点代码
jQuery(document).ready(function(){
    //流程提交前验证明细表1权重
    checkCustomize = function() {
        var mx1qz  = 0.0;
        $("input[id^='field38929_']").each(function(){
            mx1qz = parseInt(($(this).val()==""?0:$(this).val()))+mx1qz;
        });
        if (mx1qz!='100') {
            alert("明细表1权重总和必须为100%！当前明细表1权重总和为："+(mx1qz==''?0:mx1qz)+"%");
            return false;
        }
        return true;
    }

    //隐藏字段
   // $("#field26376span,#field26377span,#field26382span,#field26383span").css("display","none");
});


//第六节点  自评分0-10  //38930
jQuery(document).ready(function(){
    checkCustomize = function() {
        //自评必须为0-100
        var flag = false;
        var zp;
        $("input[name^='field38930_']").each(function(idx,element){
                zp = parseInt(element.value);
                if(zp<0||zp>100){
                alert("【自评】必须为0-100，当前第"+(idx+1)+"条工作任务自评："+zp);
                flag = true;
            }
        });
        if(flag){
            return false;
        }
    }
});



//第七节点  相关领导审核 0-100
jQuery(document).ready(function(){
    checkCustomize = function() {
        // 相关领导审核 0-100  38933
        var flag = false;
        var sb2 = $("#submitdtlid1").val();
        var ids;
        if (sb2.length>0) {
            ids = sb2.split(","); 
        }
        for (var index = 0; index < ids.length; index++) {
            var id = ids[index];
            var pf = $("#field38933_"+id).val();
            if (pf > 100 || pf <0) {
                 alert("领导评分必须为0-100，当前第"+(id+1)+"个明细主管评价为："+pf);
                 flag = true;
                 break;
            }
        }
        if (flag) {
            return false;
        }

    }
});


//第八节点 总监评分0-100
jQuery(document).ready(function(){
    checkCustomize = function() {
        // 相关领导审核 0-100  38933
        var flag = false;
        var sb2 = $("#submitdtlid1").val();
        var ids;
        if (sb2.length>0) {
            ids = sb2.split(","); 
        }
        for (var index = 0; index < ids.length; index++) {
            var id = ids[index];
            var pf = $("#field38931_"+id).val();
            if (pf > 100 || pf <0) {
                 alert("领导评分必须为0-100，当前第"+(id+1)+"个明细主管评价为："+pf);
                 flag = true;
                 break;
            }
        }
        if (flag) {
            return false;
        }

    }
});

